﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8" />
    <title>Led: main.cpp Source File</title>
    <link href="/Content/Help.css" rel="stylesheet" type="text/css" />
    <link href="/Content/css/tabs.css" rel="stylesheet" type="text/css" />
    <link href="/Content/css/doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <div id="header">
        <img id="logo" alt="StateForge" src="/Content/Images/StateForgeLogo.png" />
        <div id="title">
            <h1>
                Examples using state machines generated by StateBuilderCpp
            </h1>
            <h3>
                Led: main.cpp Source File
            </h3>
        </div>
        <div id="menucontainer">
            <ul id="menu">
                <li><a href="/">Home</a></li>
                <li><a href="/Home/Download">Downloads</a></li>
                <li><a href="/Help/state-machine-tools.aspx">Help</a></li>
                <li><a href="/Home/Faq">F.A.Q</a></li>
                <li><a href="/Home/About">Contact us</a></li>
            </ul>
        </div>
    </div>
<!-- Generated by Doxygen 1.7.4 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<div class="title">main.cpp</div>  </div>
</div>
<div class="contents">
<a href="main_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#include &lt;iostream&gt;</span>
<a name="l00002"></a>00002 <span class="preprocessor">#include &lt;cstdlib&gt;</span>
<a name="l00003"></a>00003 <span class="preprocessor">#include &quot;<a class="code" href="_led_8h.html">Led.h</a>&quot;</span>
<a name="l00004"></a>00004 
<a name="l00005"></a>00005 <span class="keyword">using namespace </span>std;
<a name="l00006"></a>00006 
<a name="l00007"></a><a class="code" href="main_8cpp.html#a2c3f6775325c30275d11c6abee2db6a0">00007</a> <span class="keywordtype">int</span> <a class="code" href="main_8cpp.html#a2c3f6775325c30275d11c6abee2db6a0">main</a>(<span class="keywordtype">int</span> <span class="comment">/*argc*/</span>, <span class="keywordtype">char</span> ** <span class="comment">/*argv[]*/</span>)
<a name="l00008"></a>00008 {
<a name="l00009"></a>00009   <span class="keywordtype">int</span> iReturnValue = 0;
<a name="l00010"></a>00010   cout &lt;&lt; <span class="stringliteral">&quot;Led&quot;</span> &lt;&lt; endl; 
<a name="l00011"></a>00011   <span class="keywordflow">try</span> {
<a name="l00012"></a>00012     <a class="code" href="class_led.html">Led</a> led;
<a name="l00013"></a>00013     led.<a class="code" href="class_led.html#af2c8e9e09c8d4d03c05a5c5907503cbf">On</a>();
<a name="l00014"></a>00014     led.<a class="code" href="class_led.html#a2a2812f03d8268132b6d19c7f9e9239b">Off</a>();
<a name="l00015"></a>00015   }
<a name="l00016"></a>00016   <span class="keywordflow">catch</span> (std::exception&amp; e){
<a name="l00017"></a>00017     cerr &lt;&lt; <span class="stringliteral">&quot;Exception: &quot;</span> &lt;&lt; e.what() &lt;&lt; endl;
<a name="l00018"></a>00018     iReturnValue = -1;
<a name="l00019"></a>00019   }
<a name="l00020"></a>00020   <span class="keywordflow">return</span> iReturnValue;
<a name="l00021"></a>00021 }
</pre></div></div>
</div>
﻿<div id="footer">
    <hr />
    <p>
        Copyright &copy; 2011 StateForge.</p>
    <hr />
</div>
</body> </html> 
